! function(e) {
    function t(t) {
        for (var n, o, u = t[0], c = t[1], s = t[2], l = 0, p = []; l < u.length; l++) o = u[l], i[o] && p.push(i[o][0]), i[o] = 0;
        for (n in c) Object.prototype.hasOwnProperty.call(c, n) && (e[n] = c[n]);
        for (d && d(t); p.length;) p.shift()();
        return a.push.apply(a, s || []), r()
    }

    function r() {
        for (var e, t = 0; t < a.length; t++) {
            for (var r = a[t], n = !0, u = 1; u < r.length; u++) {
                var c = r[u];
                0 !== i[c] && (n = !1)
            }
            n && (a.splice(t--, 1), e = o(o.s = r[0]))
        }
        return e
    }
    var n = {},
        i = {
            6: 0
        },
        a = [];

    function o(t) {
        if (n[t]) return n[t].exports;
        var r = n[t] = {
            i: t,
            l: !1,
            exports: {}
        };
        return e[t].call(r.exports, r, r.exports, o), r.l = !0, r.exports
    }
    o.m = e, o.c = n, o.d = function(e, t, r) {
        o.o(e, t) || Object.defineProperty(e, t, {
            enumerable: !0,
            get: r
        })
    }, o.r = function(e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
            value: "Module"
        }), Object.defineProperty(e, "__esModule", {
            value: !0
        })
    }, o.t = function(e, t) {
        if (1 & t && (e = o(e)), 8 & t) return e;
        if (4 & t && "object" == typeof e && e && e.__esModule) return e;
        var r = Object.create(null);
        if (o.r(r), Object.defineProperty(r, "default", {
                enumerable: !0,
                value: e
            }), 2 & t && "string" != typeof e)
            for (var n in e) o.d(r, n, function(t) {
                return e[t]
            }.bind(null, n));
        return r
    }, o.n = function(e) {
        var t = e && e.__esModule ? function() {
            return e.default
        } : function() {
            return e
        };
        return o.d(t, "a", t), t
    }, o.o = function(e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }, o.p = "";
    var u = window.shopifySlateJsonp = window.shopifySlateJsonp || [],
        c = u.push.bind(u);
    u.push = t, u = u.slice();
    for (var s = 0; s < u.length; s++) t(u[s]);
    var d = c;
    a.push([82, 0, 9]), r()
}({
    82: function(e, t, r) {
        "use strict";
        var n = r(19);
        r(83), (0, n.load)("*")
    },
    83: function(e, t, r) {
        "use strict";
        var n = c(r(84)),
            i = c(r(87)),
            a = r(124),
            o = r(19),
            u = r(30);

        function c(e) {
            return e && e.__esModule ? e : {
                default: e
            }
        }
        var s = "hide",
            d = {
                submitButton: "[data-submit-button]",
                submitButtonText: "[data-submit-button-text]",
                comparePrice: "[data-compare-price]",
                comparePriceText: "[data-compare-text]",
                priceWrapper: "[data-price-wrapper]",
                imageWrapper: "[data-product-image-wrapper]",
                visibleImageWrapper: "[data-product-image-wrapper]:not(.hide)",
                imageWrapperById: function(e) {
                    return d.imageWrapper + "[data-image-id='" + e + "']"
                },
                productForm: "[data-product-form]",
                productPrice: "[data-product-price]",
                thumbnail: "[data-product-single-thumbnail]",
                thumbnailById: function(e) {
                    return "[data-thumbnail-id='" + e + "']"
                },
                thumbnailActive: "[data-product-single-thumbnail][aria-current]"
            };
        (0, o.register)("product", {
            onLoad: function() {
                var e = this;
                return (0, i.default)(n.default.mark(function t() {
                    var r;
                    return n.default.wrap(function(t) {
                        for (;;) switch (t.prev = t.next) {
                            case 0:
                                return r = document.querySelector(d.productForm), t.next = 3, e.getProductJson(r.dataset.productHandle);
                            case 3:
                                e.product = t.sent, e.productForm = new ProductForm(r, e.product, {
                                    onOptionChange: e.onFormOptionChange.bind(e)
                                }), e.onThumbnailClick = e.onThumbnailClick.bind(e), e.onThumbnailKeyup = e.onThumbnailKeyup.bind(e), e.container.addEventListener("click", e.onThumbnailClick), e.container.addEventListener("keyup", e.onThumbnailKeyup);
                            case 9:
                            case "end":
                                return t.stop()
                        }
                    }, t, e)
                }))()
            },
            onUnload: function() {
                this.productForm.destroy(), this.removeEventListener("click", this.onThumbnailClick), this.removeEventListener("keyup", this.onThumbnailKeyup)
            },
            getProductJson: function(e) {
                return fetch("/products/" + e + ".js").then(function(e) {
                    return e.json()
                })
            },
            onFormOptionChange: function(e) {
                var t = e.dataset.variant;
                this.renderImages(t), this.renderPrice(t), this.renderComparePrice(t), this.renderSubmitButton(t)
            },
            onThumbnailClick: function(e) {
                var t = e.target.closest(d.thumbnail);
                t && (e.preventDefault(), this.renderFeaturedImage(t.dataset.thumbnailId), this.renderActiveThumbnail(t.dataset.thumbnailId))
            },
            onThumbnailKeyup: function(e) {
                if (13 === e.keyCode && e.target.closest(d.thumbnail)) {
                    var t = this.container.querySelector(d.visibleImageWrapper);
                    (0, u.forceFocus)(t)
                }
            },
            renderSubmitButton: function(e) {
                var t = this.container.querySelector(d.submitButton),
                    r = this.container.querySelector(d.submitButtonText);
                e ? e.available ? (t.disabled = !1, r.innerText = theme.strings.addToCart) : (t.disabled = !0, r.innerText = theme.strings.soldOut) : (t.disabled = !0, r.innerText = theme.strings.unavailable)
            },
            renderImages: function(e) {
                e && null !== e.featured_image && (this.renderFeaturedImage(e.featured_image.id), this.renderActiveThumbnail(e.featured_image.id))
            },
            renderPrice: function(e) {
                var t = this.container.querySelector(d.productPrice);
                this.container.querySelector(d.priceWrapper).classList.toggle(s, !e), e && (t.innerText = (0, a.formatMoney)(e.price, theme.moneyFormat))
            },
            renderComparePrice: function(e) {
                if (e) {
                    var t = this.container.querySelector(d.comparePrice),
                        r = this.container.querySelector(d.comparePriceText);
                    t && r && (e.compare_at_price > e.price ? (t.innerText = (0, a.formatMoney)(e.compare_at_price, theme.moneyFormat), r.classList.remove(s), t.classList.remove(s)) : (t.innerText = "", r.classList.add(s), t.classList.add(s)))
                }
            },
            renderActiveThumbnail: function(e) {
                var t = this.container.querySelector(d.thumbnailById(e)),
                    r = this.container.querySelector(d.thumbnailActive);
                t !== r && (r.removeAttribute("aria-current"), t.setAttribute("aria-current", !0))
            },
            renderFeaturedImage: function(e) {
                var t = this.container.querySelector(d.visibleImageWrapper),
                    r = this.container.querySelector(d.imageWrapperById(e));
                t.classList.add(s), r.classList.remove(s)
            }
        })
    }
});